var render = require('../lib/compile');
var cookie = require('../lib/cookie');
var session = require('../lib/session');
module.exports = {
	index	: function(callback,globals){
		var html = render('home',{a:100,b:200,c:300,query:globals.query});
		if(typeof callback == 'function'){
			callback(html);
		}
	},
	list	: function(callback){
		var html = render('list',{list:{id1:1,id2:2,id3:3}});
		if(typeof callback == 'function'){
			callback(html);
		}
	},
	test	: function(callback,globals){
		//cookie.set(globals.res,'name','shenyue');
		//var name = cookie.get(globals.req,'name');
		session(globals.req,globals.res);
		if(!globals.req.session.isVisit){
			globals.req.session.isVisit = true;
			callback('first');
		}else{
			callback('agin');
		}
		return;
		if(typeof callback == 'function'){
			callback(name);
		}
	},
	testPost	: function(callback,globals){
		
		var files = globals.req.body;
		
		
		if(typeof callback == 'function'){
			callback(post);
		}
	}
}